<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib prefix="sys" uri="/WEB-INF/tld/sys.tld" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>放款录单管理</title>
    <jsp:include page="../../import.jsp" flush="true"/>
    <style type="text/css">
        .searchArea .fieldBox .label{width: 70px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}

        .sq-button.sq-button-round.disabled{
            color: rgba(0,0,0,.30);
            background: #eaeaea;
            border: 1px solid #d8d8d8;
            cursor: not-allowed;
        }
    </style>
</head>

<body class="iframeBody">
<div class="Wrapper">
    <div class="searchArea">
        <form id="searchBar">
            <div class="fieldset1 clearFix">
                <div class="fieldBox">
                    <div class="label">合同号</div>
                    <div class="field">
                        <input name="contNo" id="contNo" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">支付表号</div>
                    <div class="field">
                        <input name="paySchNo" id="paySchNo" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">事业部</div>
                    <div class="field">
                        <input name="buOrgCd" id="buOrgCd" data-value="" placeholder="请选择" ltype="combobox">
                    </div>
                </div>
                <div class="fieldBox col_33" >
                    <div class="label">项目类型</div>
                    <div class="field">
                        <input type="text" name="prjTypCd" id="prjTypCd" data-value="" placeholder="请选择" ltype="combobox">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">客户姓名</div>
                    <div class="field">
                        <input name="cstNm" id="cstNm" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">实付时间</div>
                    <div class="field">
                        <input ligerui="width: 82" name="actPayTmBg" id="actPayTmBg" type="text" class="ui-datepicker" value="">
                        -
                        <input ligerui="width: 82" name="actPayTmEd" id="actPayTmEd" type="text" class="ui-datepicker" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">付款金额</div>
                    <div class="field">
                        <input ligerui="width: 82" name="payAmtMin" id="payAmtMin" type="text" class="ui-textbox" value="">
                        -
                        <input ligerui="width: 82" name="payAmtMax" id="payAmtMax" type="text" class="ui-textbox" value="">
                    </div>
                </div>

                <div class="fieldBox">
                    <div class="label">放款状态</div>
                    <div class="field">
                        <input name="payStsCd" id="payStsCd" data-value="" placeholder="请选择" ltype="combobox">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">客户经理</div>
                    <div class="field">
                        <input name="cstMgrNm" id="cstMgrNm" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">首期款代收</div>
                    <div class="field">
                        <input name="isFstCol" id="isFstCol" data-value="" placeholder="请选择" ltype="combobox">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">申请来源</div>
                    <div class="field">
                        <input name="applyResCd" id="applyResCd" data-value="" placeholder="请选择" ltype="combobox">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">保险分期</div>
                    <div class="field">
                        <input name="installmentCd" id="installmentCd" data-value="" placeholder="请选择" ltype="combobox">
                    </div>
                </div>
                <div class="fieldBox col_33" id="searchInsCodeId" <sys:resourceAuth resCd="noThdOrg">style="display: none" </sys:resourceAuth>>
                    <div class="label">第三方机构</div>
                    <div class="field">
                        <select name="insCode"  id="insCode" >
                            <option value="  " selected="selected">--请选择--</option>
                            <c:forEach items="${friBaseList}" var="fri">
                                <option value="${fri.insCode}">${fri.fundRasInsNm}</option>
                            </c:forEach>
                        </select>
                    </div>
                </div>
                <div class="fieldBox col_50" id="isSplMfrDiv" >
                    <div class="label">厂商业务</div>
                    <div class="field">
                        <select name="isSplMfr"  id="isSplMfr"  >
                            <option value="  ">请选择</option>
                            <option value="0">否</option>
                            <option value="1">是</option>
                        </select>
                    </div>
                </div>
                <div class="fieldBox col_33" id="isInsBizDiv" >
                    <div class="label">是否资管业务</div>
                    <div class="field">
                        <select name="isInsBiz"  id="isInsBiz"  >
                            <option value=" "  selected="selected">-请选择-</option>
                            <option value="0">否</option>
                            <option value="1">是</option>
                        </select>
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">业务归属城市</div>
                    <div class="field">
                        <div class="field">
                            <jsp:include page="../../system/sysRegion/region.jsp" flush="true" >
                                <jsp:param name="regionShowLvl" value="2"/>
                            </jsp:include>
                        </div>
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">领取状态</div>
                    <div class="field">
                        <input name="receiveState" id="receiveState" data-value="" placeholder="请选择" ltype="combobox">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">领取人</div>
                    <div class="field">
                        <input name="receiveUsrNm" id="receiveUsrNm" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">发送时间</div>
                    <div class="field">
                        <input ligerui="width: 82" name="sendTmBg" id="sendTmBg" type="text" class="ui-datepicker" value="">
                        -
                        <input ligerui="width: 82" name="sendTmEd" id="sendTmEd" type="text" class="ui-datepicker" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">领取时间</div>
                    <div class="field">
                        <input ligerui="width: 82" name="receiveTmBg" id="receiveTmBg" type="text" class="ui-datepicker" value="">
                        -
                        <input ligerui="width: 82" name="receiveTmEd" id="receiveTmEd" type="text" class="ui-datepicker" value="">
                    </div>
                </div>
                <div class="clearFix"></div>
                <div class="btnsBox">
                    <span id="searchBtn" class="sq-button sq-button-round">查询</span>
                    <span id="clearBtn" class="sq-button sq-button-round">清空</span>
                    <input id="resetBtn" type="reset" value="重置" class="l-button l-button-reset Hide"/>
                </div>
            </div>
        </form>
    </div>
    <div class="sqPanel" style="margin-bottom: 0;">
        <div class="sqPanel_head" style="float:left;color: red">
            <table class="table_full">
                <tr>
                    <td>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b><i class="ico_flasher"></i></b>仅支持近一年内的数据查询
                    </td>
                </tr>
            </table>
        </div>
        <div id="ligergrid1" class="sq-grid"></div>
    </div>
</div>

<script type="text/javascript">
    var _usrId = '${currentUsrId}';//当前用户ID
    var grid = null,callback=null;
    $(function () {
        //初始化列表
        initGrid();
        //false不显示，true显示
        grid.toggleCol('thdPayDt', false);
        grid.toggleCol('thdPayAmt', false);
        grid.setHeight(100);

        //项目类型下拉框
        var _prjTypCdList = ${prjTypCdList};
        $("#prjTypCd").ligerComboBox({
            isShowCheckBox: true,
            isMultiSelect: true,
            data: _prjTypCdList,
            valueField: 'key',
            textField: 'value'
        });

        $("#searchBar").ligerForm();
        //事业部
        $("#buOrgCd").ligerComboBox({
            valueField: 'key',
            textField: 'value'
        });
        liger.get("buOrgCd").setData(${buOrgCdList});
        //付款状态
        $("#payStsCd").ligerComboBox({
            valueField: 'key',
            textField: 'value'
        });
        liger.get("payStsCd").setData(${payStsCdList});
        //申请来源
        $("#applyResCd").ligerComboBox({
            valueField: 'key',
            textField: 'value'
        });
        liger.get("applyResCd").setData(${applyResCdList});
        //首期款代收
        $("#isFstCol").ligerComboBox({
            valueField: 'key',
            textField: 'value'
        });
        liger.get("isFstCol").setData(${fstColCdList});
        //保险分期
        $("#installmentCd").ligerComboBox({
            valueField: 'key',
            textField: 'value'
        });
        liger.get("installmentCd").setData(${fstColCdList});
        //领取状态
        $("#receiveState").ligerComboBox({
            valueField: 'key',
            textField: 'value'
        });
        liger.get("receiveState").setData(${receiveStsCdList});

        $("#pageloading").hide();

        /* 查询 */
        $("#searchBtn").click(function (event) {
            // 归属城市校验，查询条件选择省后，市必须  rgnProvCd  rgnCityCd
            if ($("#rgnProvCd").val() != "" && $("#rgnCityCd").val() == "") {
                $.ligerDialog.SQalert({content: "归属城市不能为空", SQ_type: "warning"});
                return;
            }
            var form = liger.get("searchBar");
            var data = form.getData();
            for (name in data) {
                grid.setParm(name, data[name]);
            }
            if(StringUtils.isNotEmpty($("#stDt").val()) && StringUtils.isNotEmpty($("#endDt").val()) && $("#stDt").val()>$("#endDt").val()){
                $.ligerDialog.SQalert({content: "发送日期(起)不能大于发送日期(止)" , SQ_type: "warning" });
                return;
            }
            var date1 = new Date();
            date1.setFullYear(date1.getFullYear()-1);
            date1.setDate(date1.getDate() + 1);
            if (StringUtils.isEmpty($("#sendTmBg").val())){
                grid.setParm("sendTmBg",DateUtils.formatDate(date1,DateUtils.YYYY_MM_DD));
            }
            var flag = false;
            if (StringUtils.isNotEmpty($("#sendTmBg").val()) && $("#sendTmBg").val() < DateUtils.formatDate(date1,DateUtils.YYYY_MM_DD)){
                flag = true;
            }
            if (StringUtils.isNotEmpty($("#sendTmEd").val()) && $("#sendTmEd").val() < DateUtils.formatDate(date1,DateUtils.YYYY_MM_DD)){
                flag = true;
            }
            if (flag){
                top.$.ligerDialog.SQalert({content: "仅支持查询实付时间/发送时间/领取时间至今一年内数据",SQ_type: "success"});
                grid.setParm("sendTmBg",DateUtils.formatDate(date1,DateUtils.YYYY_MM_DD));
            }
            grid.reload();
        });

        /* 清空 */
        $("#clearBtn").click(function (event) {
            clearLigerForm("searchBar");
        });

        callback = function () {
            grid.reload();
        };
    });

    //初始化列表
    function initGrid() {
        grid = $("#ligergrid1").ligerGrid({
            url: '<%=path%>/capital/capPayInfo/initPayRecList.do',
            method: 'get',
            columns: [
                {display: '客户名称', name: 'cstNm', minWidth: 100, align: 'left', enabledSort: false},
                {display: '合同号', name: 'contNo', width: 140, align: 'left', enabledSort: false},
                {display: '支付表号', name: 'paySchNo', width: 150, align: 'left', enabledSort: false},
                {display: '第三方机构', name: 'fundRasInsNm', width: 150, align: 'left', enabledSort: false},
                {display: '放款金额', name: 'payAmt', width: 100, align: 'right', enabledSort: false,
                    render:function(rowdata,index,value){
                        return '&yen;'+FormatMoney(rowdata.payAmt/100);
                    }
                },
                {display: '实际放款金额', name: 'actPayAmt', width: 100, align: 'right', enabledSort: false,
                    render:function(rowdata,index,value){
                        if(rowdata.actPayAmt){
                            return '&yen;'+FormatMoney(rowdata.actPayAmt/100);
                        }
                    }
                },
                {display: '实际放款时间', name: 'actPayTm', width: 80, align: 'center', enabledSort: false,render:renderDate},
                {display: '机构实际放款金额', name: 'thdPayAmt', id:"thdPayAmt",width: 100, align: 'right', enabledSort: false,
                    render:function(rowdata,index,value){
                        if(rowdata.thdPayAmt){
                            return '&yen;'+FormatMoney(rowdata.thdPayAmt/100);
                        }
                    }
                },
                {display: '机构实际放款时间', name: 'thdPayDt', id:"thdPayDt",width: 100, align: 'center', enabledSort: false,render:renderDate},
                {display: '流程编号', name: 'prInsNo', minWidth: 140, align: 'center', enabledSort: false,
                    render: function (rowdata, rowindex, value, column) {
                        var h = '';
                        if(value&&value!="null"){
                            if(StringUtils.isNotEmpty(rowdata.buOrgCd) && rowdata.buOrgCd==ProjectConstant.CODE_BU_ORG_CD_CAR){
                                if(StringUtils.isNotEmpty(rowdata.bizFlag) && rowdata.bizFlag == '2'){
                                    h+='<a href="javascript:commShowFlowForGHYW(';
                                    h+="'"+rowdata.bizFlag+"',";
                                }else{
                                    h+='<a href="javascript:commShowFlowForCarBiz(';
                                }
                            }else if(StringUtils.isNotEmpty(rowdata.buOrgCd) && rowdata.buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZC){
                                h+='<a href="javascript:commShowFlowForSpecialCar(';
                            }else{
                                h+='<a href="javascript:commShowFlow(';
                            }
                            h+="'"+rowdata.prInsId+"',";
                            h+="'"+rowdata.audStsCd+"',";
                            h+="'"+rowdata.id+"'";
                            h+=')">'+value+'</a>'
                        }
                        return h;
                    },
                },
                {display: '付款类型', name: 'payTypCdNm', width: 80, align: 'center', enabledSort: false},
                {display: '项目类型', name: 'prjTypCdNm', width: 80, align: 'center', enabledSort: false},
                { display: '是否资管业务', name: 'isInsBiz', minWidth: 100 , enabledSort:true,
                    render: function (rowdata, rowindex, value, column) {
                        if (rowdata.isInsBiz == 1) {
                            return "是";
                        } else if (rowdata.isInsBiz == 0) {
                            return "否";
                        }
                    }
                },
                { display: '是否厂商业务', name: 'isSplMfr', minWidth: 100 , enabledSort:true,
                    render: function (rowdata, rowindex, value, column) {
                        if (rowdata.isSplMfr == 1) {
                            return "是";
                        } else if (rowdata.isSplMfr == 0) {
                            return "否";
                        }
                    }
                },
                {display: '客户经理', name: 'cstMgrNm', width: 80, align: 'center', enabledSort: false},
                {display: '所属事业部', name: 'buOrgCdNm', width: 100, align: 'center', enabledSort: false},
                {display: '省公司', name: 'prOrgCdNm', width: 100, align: 'center', enabledSort: false},
                {display: '分公司', name: 'cyOrgCdNm', width: 100, align: 'center', enabledSort: false},
                {display: '放款状态', name: 'payStsCdNm', width: 80, align: 'center', enabledSort: false},
                {display: '领取状态', name: 'receiveStateNm', width: 80, align: 'center', enabledSort: false},
                {display: '发送时间', name: 'sendTm', width: 120, align: 'center', enabledSort: false,render:renderDateDetail},
                {display: '领取时间', name: 'receiveTm', width: 120, align: 'center', enabledSort: false,render:renderDateDetail},
                {display: '提交时间', name: 'submitTm', width: 120, align: 'center', enabledSort: false,render:renderDateDetail},
                {display: '领取人', name: 'receiveUsrNm', width: 80, align: 'center', enabledSort: false,
                    render: function (rowdata, rowindex, value, column) {
                        if (rowdata.receiveState == "1") {
                            return null;
                        } else {
                            return rowdata.receiveUsrNm;
                        }
                    }
                },
                {
                    display: '操作', name: 'actions', minWidth: 100, enabledSort: true,
                    render: function (rowdata, rowindex, value) {
                        var j = "";
                        j += '<a href="javascript:toDetailPage(';
                        j += "'" + rowindex + "'";
                        j += ')">查看</a>';
                        if (rowdata.receiveState == 1 && StringUtils.isEmpty(rowdata.prInsNo)) {
                            j += '<a href="javascript:receivePayRecord(';
                            j += "'" + rowindex + "'";
                            j += ')"> 领取</a>';
                        } else if (rowdata.receiveState == "2" && rowdata.crtUsrId == _usrId
                            && (rowdata.payStsCd == "1" || rowdata.payStsCd == "4")) {
                            j += '<a href="javascript:modifyPayRecord(';
                            j += "'" + rowindex+ "'";
                            j += ')"> 修改</a>';
                        }
                        return j;
                    }
                }
            ],
            pageSize: 10,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            height: '100%',
            heightDiff: -2,
            checkbox: true,
            rownumbers: true,
            allowUnSelectRow: true,
            alternatingRow: true,
            isSingleCheck:true
        });
    }

    //进入详情页面
    function toDetailPage(_index) {
        var data = grid.rows[_index];
        var type = data.payTypCd;
        var flowKey = data.procDefKey;
        //付款申请单页面取的是当前用户orgcd，该处取客户经理的
        var cstMgrOrgCd = data.cstMgrOrgCd;
        var params = '&&isAllowPay=0';
        if (data.buOrgCd != null && '' != data.buOrgCd && ProjectConstant.CODE_BU_ORG_CD_ZC == data.buOrgCd) {//专车事业部
            if (cstMgrOrgCd.indexOf(ProjectConstant.CODE_ORG_CD_YZDG) >= 0) {//以租代购
                Add_navTab("CapPayInfo_" + data.id, "付款申请单", '<%=path%>/capital/capPayInfo/toAddPageBySpecialCar.do?id=' + data.id + "&payTypCd=" + type+params, callback);
            } else {
                Add_navTab("CapPayInfo_" + data.id, "付款申请单", '<%=path%>/capital/capPayInfo/toAddPageBySpecialCar.do?id=' + data.id + "&payTypCd=" + type+params, callback);
            }
        } else {
            if (data.bizFlag != null && data.bizFlag == '2') {//形式直租(乘用车)
                Add_navTab("CapPayInfo_" + data.id, "付款申请单", '<%=path%>/capital/capPayInfo/toAddPage.do?id=' + data.id + "&payTypCd=" + type + "&bizFlag=" + data.bizFlag+params, callback);
            } else {//回租  其他
                Add_navTab("CapPayInfo_" + data.id, "付款申请单", '<%=path%>/capital/capPayInfo/toAddPage.do?id=' + data.id + "&payTypCd=" + type + "&flowKey=" + flowKey+params, callback);
            }
        }
    }

    //进入修改页面
    function modifyPayRecord(_index) {
        var data = grid.rows[_index];
        var type = data.payTypCd;
        var flowKey = data.procDefKey;
        //付款申请单页面取的是当前用户orgcd，该处取客户经理的
        var cstMgrOrgCd = data.cstMgrOrgCd;
        if (data.payStsCd != 1 && data.payStsCd != 4) {//未申请或申请不通过
            top.$.ligerDialog.SQalert({content: "已申请放款请勿重复申请", SQ_type: "warning"});
            return;
        }
        if (type == null) {
            top.$.ligerDialog.SQalert({content: "未获取到放款类型", SQ_type: "warning"});
            return;
        }
        if (data.buOrgCd != null && '' != data.buOrgCd && ProjectConstant.CODE_BU_ORG_CD_ZC == data.buOrgCd) {//专车事业部
            if (cstMgrOrgCd.indexOf(ProjectConstant.CODE_ORG_CD_YZDG) >= 0) {//以租代购
                Add_navTab("CapPayInfo_" + data.id, "付款申请单", '<%=path%>/capital/capPayInfo/toAddPageBySpecialCar.do?entrance=0&&rcptUntIsMdf=2&id=' + data.id + "&payTypCd=" + type+"&operateInsPlc="+'1', callback);
            } else {
                Add_navTab("CapPayInfo_" + data.id, "付款申请单", '<%=path%>/capital/capPayInfo/toAddPageBySpecialCar.do?entrance=0&rcptUntIsMdf=2&id=' + data.id + "&payTypCd=" + type+"&operateInsPlc="+'1', callback);
            }
        } else {
            if (data.bizFlag != null && data.bizFlag == '2') {//形式直租(乘用车)
                Add_navTab("CapPayInfo_" + data.id, "付款申请单", '<%=path%>/capital/capPayInfo/toAddPage.do?entrance=3&id=' + data.id + "&payTypCd=" + type + "&bizFlag=" + data.bizFlag+"&operateInsPlc="+'1', callback);
            } else {//回租  其他
                Add_navTab("CapPayInfo_" + data.id, "付款申请单", '<%=path%>/capital/capPayInfo/toAddPage.do?entrance=3&id=' + data.id + "&payTypCd=" + type + "&flowKey=" + flowKey+"&operateInsPlc="+'1', callback);
            }
        }
    }

    //领取
    function receivePayRecord(_index) {
        var rowdata = grid.rows[_index];
        //台账ID
        var bookId = rowdata.bookId;
        var bookTypeCd = rowdata.bookTypeCd;
        var prjId = rowdata.prjId;
        if (!bookId || !bookTypeCd) return;
        $.ligerDialog.confirm('确定领取吗？', function (flag) {
            if (flag == false) {
                return;
            }
            var parms = {
                id: bookId,
                bookTypeCd: bookTypeCd,
                receiveState: "2",
                prjId: prjId
            }
            var _url = '<%=path%>/audit/audStandingBook/modifyReceiveState.do';
            AjaxUtils.ajaxPost(_url, parms, function (msg) {
                if (msg.success == 1) {
                    UIUtils.alertSuccess(msg.info);
                    grid.reload();
                } else {
                    UIUtils.alertError(msg.info);
                }
            }, true);
        });
    }

    //显示流程
    function commShowFlow(_pInstId,_audStsCd,_businessKey){
        if(StringUtils.isEmpty(_pInstId)){
            UIUtils.alertWarning(CommonConstant.C_P_INSTANCEID_NOT_HERE);
            return;
        }
        var _formUrl = "/capPay/flow/toAdditionalInfoPage.do?version=2@@capPayId=";
        var params = "?pInsId="+_pInstId+"&status="+_audStsCd+"&businessKey="+_businessKey+"&formUrl="+_formUrl;
        Add_navTab('tab_cst_invoice_flow_'+_businessKey,'查看流程',"<%=path%>/flow/flow/toFlowShowPageFowBus.do"+params);
    }


    //显示流程-汽车金融工行业务
    function commShowFlowForGHYW(_bizFlag,_pInstId,_audStsCd,_businessKey){
        if(StringUtils.isEmpty(_pInstId)){
            UIUtils.alertWarning(CommonConstant.C_P_INSTANCEID_NOT_HERE);
            return;
        }
        var _formUrl = "/capital/capPayInfo/toAddPage.do?accCtrl=1@@ctrlKey=3@@bizFlag="+_bizFlag+"@@id=";
        var params = "?pInsId="+_pInstId+"&status="+_audStsCd+"&businessKey="+_businessKey+"&formUrl="+_formUrl;
        Add_navTab('tab_cst_invoice_flow_'+_businessKey,'查看流程',"<%=path%>/flow/flow/toFlowShowPageFowBus.do"+params);
    }

    //显示流程-汽车金融
    function commShowFlowForCarBiz(_pInstId,_audStsCd,_businessKey){
        if(StringUtils.isEmpty(_pInstId)){
            UIUtils.alertWarning(CommonConstant.C_P_INSTANCEID_NOT_HERE);
            return;
        }
        var _formUrl = "/capital/capPayInfo/toAddPage.do?accCtrl=1@@ctrlKey=3@@id=";
        var params = "?pInsId="+_pInstId+"&status="+_audStsCd+"&businessKey="+_businessKey+"&formUrl="+_formUrl;
        Add_navTab('tab_cst_invoice_flow_'+_businessKey,'查看流程',"<%=path%>/flow/flow/toFlowShowPageFowBus.do"+params);
    }

    //显示流程-专车事业部
    function commShowFlowForSpecialCar(_pInstId,_audStsCd,_businessKey){
        if(StringUtils.isEmpty(_pInstId)){
            UIUtils.alertWarning(CommonConstant.C_P_INSTANCEID_NOT_HERE);
            return;
        }
        var _formUrl = "/capital/capPayInfo/toAddPageBySpecialCar.do?entrance=0@@id=";
        var params = "?pInsId="+_pInstId+"&status="+_audStsCd+"&businessKey="+_businessKey+"&formUrl="+_formUrl;
        Add_navTab('tab_cst_invoice_flow_'+_businessKey,'查看流程',"<%=path%>/flow/flow/toFlowShowPageFowBus.do"+params);
    }

    //格式化时间
    function renderDate(rowdata, index, value) {
        var dateStr = "";
        if (null != value) {
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
        }
        return dateStr;
    }
    //格式化时间
    function renderDateDetail(rowdata, index, value) {
        var dateStr = "";
        if (null != value) {
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DDHHMMSS);
        }
        return dateStr;
    }
</script>

</body>
</html>
